package cos.android.mapfog;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class BlackView extends SurfaceView {

	public BlackView(Context context, AttributeSet attrs) {
		super(context, attrs);

		Bitmap mBackgroundImage;
		Resources res = context.getResources();
		SurfaceHolder holder = getHolder();
		// cache handles to our key sprites & other drawables
		mBackgroundImage = BitmapFactory.decodeResource(res,
				R.drawable.earthrise);

		Canvas c = null;
		try {
			c = holder.lockCanvas(null);
		} finally {
			// do this in a finally so that if an exception is thrown
			// during the above, we don't leave the Surface in an
			// inconsistent state
			if (c != null) {
				holder.unlockCanvasAndPost(c);
			}
		}

		c.drawBitmap(mBackgroundImage, 0, 0, null);

	}

}
